<?php

eb_include_class("EbDataHolder");

class EbRequest extends EbDataHolder
{
	var $url;
	var $queryuri;
	var $referer;
	var $parameters;
	var $method;
	var $listUrlParameters;
	var $event;
	
	public function __construct()
	{
		$this->url  = ( isset($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
		$this->url .= $_SERVER['HTTP_HOST'];
		$this->url .= $_SERVER['REQUEST_URI'];
		$this->method = strtolower($_SERVER["REQUEST_METHOD"]);
		$this->referer = isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : null;
		
		$original = parse_url($this->url);
			
		$this->queryuri = preg_replace('|/index\.php$|', '/', $original['path']);
			
		if ($this->queryuri[0] == '/') $this->queryuri = substr($this->queryuri,1);
					
		foreach ($_GET as $key=>$value)
		{
			$this->setData($key,$value);
		}
		
		foreach ($_POST as $key=>$value)
		{
			$this->setData($key,$value);
		}
	}
}

?>